-
Couldn't load subscription status.
- Fork 519
Allow either node to send tx_init_rbf in v2 establishment
#1236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have prototyped this in ACINQ/eclair#3021 and I don't see any reason to disallow it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Splicing allows either node to send `tx_init_rbf` as they may want to take the opportunity to contribute or withdraw additional funds to / from the channel. Allow the same for v2 channel establishment for consistency.
7feaee0 to
966e550
Compare
|
Squashed the fixups. @vincenzopalazzo Anyone else from CLN need to chime in on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 966e550
|
I haven't tested it but this should work fine in CLN. We essentially treat RBF as just a |
|
@ddustin be careful, it must NOT be treated as |
|
@ddustin I tested against |
| The sender of `tx_init_rbf`: | ||
| - MUST be the *initiator* | ||
| - MAY be either the *initiator* or the *accepter* | ||
| - If the sender is the accepter, it becomes the initiator of the `interactive-tx` session and thus: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! Looking at updating CLN to accommodate this, and ran into a question which seems obvious but wanted to confirm.
I'm taking this to mean that the serial_ids and all other role-related indicators are swapped for the entirety of the tx construction phase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct
Work in progress to allow acceptor to initiate an RBF Mostly works, except that the original funder isn't setup to re-add their original funds to the channel, so the init fails because it's missing any overlapping inputs. lightning/bolts#1236
|
Is it an implementation detail to have the OG opening peer re-adding their original inputs to the transaction or is that something we should specify? |
I'd say it's an implementation detail. They could choose to not add them / take the opportunity to use entirely different inputs / amounts. |
Oh, and since they are no longer the initiator, they wouldn't be paying for the common fields nor the funding output. So they may decide to choose different UTXOs to spend as their fee responsibility may decrease. |
|
One issue we ran into on CLN is that without a common input with the
previous tx, the RBF attempt fails (our checks don’t allow a second tx for
a channel to be signed).
For splicing, you’re guaranteed to have at least the prev channel outpoint
in the tx, but for a new channel there’s not an obvious common outpoint.
…On Tue, Oct 21, 2025 at 17:27 Jeffrey Czyz ***@***.***> wrote:
*jkczyz* left a comment (lightning/bolts#1236)
<#1236 (comment)>
I'd say it's an implementation detail. They could choose to not add them /
take the opportunity to use entirely different inputs / amounts.
Oh, and since they are no longer the initiator, they wouldn't be paying
for the common fields nor the funding output. So they may decide to choose
different UTXOs to spend as their fee responsibility may decrease.
—
Reply to this email directly, view it on GitHub
<#1236 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIMAKNI4BAHA5EUGUU5MI33Y2XNTAVCNFSM6AAAAABYWRXSNOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIMRZG44TGMJWGY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Agreed, we want to ensure that there is a common input with the previous versions of the transaction, otherwise they don't double-spend each other and we can in theory end up with two confirmed funding transactions for the same channel! But as long as the initiator of the RBF ensures that they double-spend themselves, it's fine? Note that if you didn't have any input in the previous interactive-txs, then you have no reason to initiate RBF, you don't have any balance in that channel. If you do initiate RBF anyway, you then indeed need to check that your peer re-adds an input so that this new interactive-tx double-spends all previous attempts. |
|
Had a quick chat with @rustyrussell about this and he suggested we add a simple rule: For any RBF attempt (independent of who's initiated it) the node must include at least one of their inputs from the previous transaction. This would allow for anyone to initiate an RBF (independent of what they've previously contributed) and also guarantee that there's never an issue with forgetting to include overlapping inputs with the prior version of the transaction. |
Work in progress to allow acceptor to initiate an RBF Mostly works, except that the original funder isn't setup to re-add their original funds to the channel, so the init fails because it's missing any overlapping inputs. lightning/bolts#1236
I thought this was already in the spec, but I cannot find it. This is already a requirement today, even when the initiator is the only one allowed to RBF, so this should have been specified in the dual funding PR. @jkczyz can you add that requirement in the We should also add a requirement in the Does that match what is already implemented in |
Should we include the requirement for the sender of For v2 establishment, if the RBF initiator did not contribute to previous attempts, couldn't the other party refuse to add one of their previous inputs? I guess they wouldn't have an incentive to -- if they're the original initiator then they wanted to open the channel -- but an implementation may (inadvertently) choose a different UTXO because fee responsibilities would have changed now that they need to pay for less. Similarly for any subsequent RBF attempts. It may be too strict a requirement, though, when both parties have contributed to a previous attempt. Just trying to think if there's a way to state the requirement to avoid a scenario where we can't RBF again because one party isn't aware they need to contribute a specific input. Also, presumably, you will update the splicing PR to elide the new
Hmmm.. There are two sections named "The
LDK hasn't implemented RBF yet. |
Yes, good point!
Note that the RBF initiator actually has to contribute funds, because they must pay for the fees of the common transaction fields and the channel output, which is impossible to do if they don't add any input to the transaction. There are indeed weird games that nodes can play if they don't have an incentive to accept the RBF attempt (but in most cases they do, the other side will be the one paying more fees since the RBF initiator pays fees for the common transaction fields). Anyway, I don't think it matters that much: any games that nodes play during RBF will be caught by the
I think that the implementation should prevent that: if you're paying less fees, you should re-use the same UTXO(s) but increase your change output (or add one if there wasn't any before).
Good point as well, we can remove this requirement entirely for the splicing case since the previous channel output ensures the double-spending condition.
Right, I missed it because it's not in the table of contents, but it does state what we want! I was surprised it wasn't already present, it's a good thing that it actually is here (and it makes sense to have in the "Channel Establishment v2" section, since splicing won't need this check). |
Splicing allows either node to send
tx_init_rbfas they may want to take the opportunity to contribute or withdraw additional funds to / from the channel. Allow the same for v2 channel establishment for consistency.